package com.wuhan.template.module.wode.activity;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.wuhan.template.R;
import com.wuhan.template.base.BaseActivity;
import com.wuhan.template.views.CacheCleanUtils;

import java.io.File;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2016/5/14 0014.
 */
public class SheZhiActivity extends BaseActivity{

    @BindView(R.id.cacheSize)
    protected TextView cache;

    @BindView(R.id.btn_clear)
    protected RelativeLayout layout;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_shezhi;
    }

    @Override
    protected void initViews() {

        try {
            String cacheSize = CacheCleanUtils.getCacheSize(new File("/mnt/sdcard/imagecache"));
            cache.setText(cacheSize);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    @OnClick(R.id.btn_clear)
    public void clearData(View view){
        CacheCleanUtils.deleteFolderFile((new File("/mnt/sdcard/imagecache")).getPath(),true);
        try {
            String cacheSize = CacheCleanUtils.getCacheSize(new File("/mnt/sdcard/imagecache"));
            cache.setText(cacheSize);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @OnClick(R.id.btn_guanyuwomen)
    public void woMen(View view){

        Intent intent = new Intent(this,AboutOurActivity.class);
        startActivity(intent);
    }
}
